﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LabMS.Web.Equipment.Instrument
{
    public partial class instrumentborrowquery : Base.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("SYYQLY");//必须写在ispostback外
            strPagePrivilege.Add("SYYQGL");
            strPagePrivilege.Add("SYYQHZ");
            strPageUserType.Add("mana");
            if (!Page.IsPostBack)
            {
                bind(" Type='yiqi' ");
            }
        }

        public void bind(string strWhere)
        {
            BLL.Recipients brecipients = new LabMS.BLL.Recipients();
            List<Model.Recipients> recipient = brecipients.GetModelList(strWhere);
            gvInstrument.DataSource = recipient;
            gvInstrument.DataBind();
        }
        protected void GridViewConsum_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            gvInstrument.PageIndex = e.NewPageIndex;
            if (!tbKeyWords.Text.Trim().Equals(""))
            {
                string strwhere = " Type='yiqi' and " + ddlCClass.SelectedValue + " like '%" + tbKeyWords.Text.Trim() + "%;";
                bind(strwhere);
            }
            else
            {
                bind(" Type='yiqi' ");
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (!tbKeyWords.Text.Trim().Equals(""))
            {
                string strwhere = " Type='yiqi' and " + ddlCClass.SelectedValue + " like '%" + tbKeyWords.Text.Trim() + "%'";
                bind(strwhere);
            }
        }

        protected void lbRefresh_Click(object sender, EventArgs e)
        {
            bind(" Type='yiqi' ");
        }

    }
}
